package dao;

import java.sql.CallableStatement;
import java.sql.Connection;

import connectUtil.ConnectionUtil;
import controller.EncyptPassword;

public class UpdateNewPassVisitorDAO {
	private static Connection conn;
    private static CallableStatement callProc;
    
    public static boolean isResetPassword(String email, String password) {
    	try {
    		conn = ConnectionUtil.getConnection();
    		callProc = conn.prepareCall("{call resetPassword(?,?)}");
    		callProc.setString(1, email);
    		callProc.setString(2, password);    		
    		if (callProc.executeUpdate() == 0) {
    			return false;
    		}
    	} catch (Exception ex) {
    		
    	} finally {
    		ConnectionUtil.closeConnections(conn, callProc, null);
    	}
    	
    	return true;
    }
}
